home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / svdfunct.pro < prev    next >
Text File  |  1997-07-08  |  538b  |  21 lines

  1. ; $Id: svdfunct.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2.  
  3. function svdfunct,X,M
  4. ;
  5. ;       Default function for SVDFIT
  6. ;
  7. ;       Accepts scalar X and M, returns
  8. ;       the basis functions for a polynomial series.
  9. ;
  10.         XX=X[0]                 ; ensure scalar XX
  11.     sz=reverse(size(XX))    ; use size to get the type
  12.         IF sz[n_elements(sz)-2] EQ 5 THEN $
  13.         basis=DBLARR(M) else basis=FLTARR(M)
  14. ;
  15. ;       Calculate and return the basis functions
  16. ;
  17.         basis[0]=1.0
  18.         FOR i=1,M-1 DO basis[i]=basis[i-1]*XX
  19.     return,basis
  20. end
  21.